package com.feini.ktv.svc.controller.om;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.feini.ktv.svc.entity.om.OmOrderH;
import com.feini.ktv.svc.service.om.IOmOrderHService;
import com.podara.skeleton.controller.SkeletonController;
import com.podara.skeleton.log.annotation.LogLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author jiangzr
 * @since 2021-04-13
 */
@LogLogger
@RestController
public class OmOrderHController implements SkeletonController {
    @Autowired
    private IOmOrderHService orderHService;

    @GetMapping("/queryOrderHList")
    public List<OmOrderH> queryOrderHList() {
        QueryWrapper<OmOrderH> orderQueryWrapper = new QueryWrapper<OmOrderH>();
        orderQueryWrapper.eq("order_status", "1");
        List<OmOrderH> sellers = this.orderHService.list(orderQueryWrapper);
        return sellers;
    }

    @GetMapping("/queryOrderHListById/{orderId}")
    public List<OmOrderH> queryOrderHListById(@PathVariable("orderId") String orderId) {
        QueryWrapper<OmOrderH> orderQueryWrapper = new QueryWrapper<OmOrderH>();
        orderQueryWrapper.eq("order_status", "1");
        orderQueryWrapper.eq("order_id", orderId);
        List<OmOrderH> sellers = this.orderHService.list(orderQueryWrapper);
        return sellers;
    }
}

